class Dog:
    def __init__(self, name, age):
        self.name = name
        self.age = age

    def wang(self):
        print(self.name.title() + '旺旺')
    def __a(self):#双下划线开始表示私有方法
        print(self.age)
        print(str(dog.age))
    def shen(self):
        print(self.name.title() + '伸舌头')
        self.__a()#私有方法在类内使用
dog = Dog('xiaohei', 5)
dog.wang()
dog.shen()


